package com.example.demo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * Created by hongzhenyue on 18/2/26.
 */

/**
 * 消息消费者
 */
@Component
public class Consumer {

//    @Value("${spring.mail.username}")
//    private String emailFrom;
//
//    public String getEmailFrom() {
//        return emailFrom;
//    }

    @JmsListener(destination = "demo.queue")
    public void readQueue(String text) {
        System.out.println(text);
//        System.out.println("邮箱账号：" + emailFrom);
    }
}
